<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Site extends WD_Controller {

    public function index(){




        $page = isset($_GET["page"]) ? intval($_GET["page"]) : 1;

        $host = \libraries\waydiao\Wdata::getHost();

        $api = \libraries\waydiao\Wdata::getApiByUri("/v1/smallvideo/synthesis-list");

        $url = $host["yuxun"].$api["uri"]."?page=".$page;
        //echo $url;

        $text = \libraries\Curl::curl_get($url);

        //echo $text;


        if($result_array = json_decode($text, true)){
//            pre($result_array);

            $list = isset($result_array["body"]["list"]) ? $result_array["body"]["list"] : [];

            //pre($list);




            $ids = [];
            foreach ($list as $line){
                $ids[] = $line["id"];
            }

           // pre($ids);




        }

        $host = \libraries\waydiao\Wdata::getHost();

        $treeData = \libraries\waydiao\Wdata::getTreeData();

        $data = [
            'host' => $host,
            'treeData' => $treeData,
        ];

        $this->load->view('site/index', $data);

    }

}
